package com.dwfyc.hibernate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * ObraProveedor entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "obra_proveedor", catalog = "firmes", uniqueConstraints = @UniqueConstraint(columnNames = {
		"idObra", "idProveedor" }))
public class ObraProveedor implements java.io.Serializable {

	// Fields

	private Integer idObraProveedor;
	private Proveedor proveedor;
	private Obra obra;

	// Constructors

	/** default constructor */
	public ObraProveedor() {
	}

	/** full constructor */
	public ObraProveedor(Integer idObraProveedor, Proveedor proveedor, Obra obra) {
		this.idObraProveedor = idObraProveedor;
		this.proveedor = proveedor;
		this.obra = obra;
	}

	// Property accessors
	@Id
	@Column(name = "idObraProveedor", unique = true, nullable = false)
	public Integer getIdObraProveedor() {
		return this.idObraProveedor;
	}

	public void setIdObraProveedor(Integer idObraProveedor) {
		this.idObraProveedor = idObraProveedor;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idProveedor", nullable = false)
	public Proveedor getProveedor() {
		return this.proveedor;
	}

	public void setProveedor(Proveedor proveedor) {
		this.proveedor = proveedor;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idObra", nullable = false)
	public Obra getObra() {
		return this.obra;
	}

	public void setObra(Obra obra) {
		this.obra = obra;
	}

}